﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Portal.Systems.Bussiness.Template;
using Portal.Systems.Model;
using Portal.Core;
using System.Data;
using Portal.Web.Utility;
using System.Collections.ObjectModel;
using System.Data.SqlClient;
using Portal.Systems.Bussiness;

namespace Portal.Systems.Bussiness
{
    public class SystemBussinessFactory : SystemsBussinessProcessTemplate
    {
        public override string ServiceId
        {
            get
            {
                return "Portal.Systems.Bussiness.dll";
            }
        }
        public override AccountTypeCls[] ReadingAccountType(string SiteId, string ParentAccountType) 
        {
            return AccountTypeProcessBll.ReadingAccountType(SiteId, ParentAccountType); 
        }
        
        public override AccountTypeCls CreateAccountTypeModel(string SiteId, string AccountType)
        {
            return AccountTypeProcessBll.CreateAccountTypeModel(SiteId,AccountType);
        }

        public override void AddAccountType(
            string SiteId,
            string ParentAccountType,
            string AccountType,
            string Description)
        {
            AccountTypeProcessBll.AddAccountType(SiteId, ParentAccountType, AccountType, Description);
        }

        public override void SaveAccountType(string SiteId, string AccountType, string Description) 
        {
            AccountTypeProcessBll.SaveAccountType(SiteId, AccountType, Description);
        }

        public override void DeleteAccountType(string SiteId, string AccountType) 
        {
            AccountTypeProcessBll.DeleteAccountType(SiteId, AccountType);
        }

        //**************************************************************************************
        public override SystemLogCls[] ReadingSystemLog(
            string SiteId,
            string FromDate,
            string ToDate) 
        {
            return SystemLogProcessBll.ReadingSystemLog(SiteId,FromDate,ToDate); 
        }

        public override UserNotLoginCls[] ReadingUserNotLogin(
            string SiteId,
            int Month) 
        {
            return SystemLogProcessBll.ReadingUserNotLogin(SiteId, Month);
        }

        public override void AddSysLogProcess(
             string SiteId,
             string AssetCode,
             string Action,
             string ActionText,
             string UserId,
             string LoginName,
             string FullName) 
        {
            SystemLogProcessBll.AddSysLogProcess(SiteId, AssetCode, Action, ActionText, UserId, LoginName, FullName);
        }

        public override void Delete(
            string SiteId,
            string[] Ids) 
        {
            SystemLogProcessBll.Delete(SiteId, Ids);
        }

        //**********************************************************
        public override void InitPermisison(string SiteId, IPermission OPermissionTemplate)
        {
            PermissionProcessBll.InitPermisison(SiteId, OPermissionTemplate);
        }

        public override PermissionRoleCls[] ReadingPermissionRoles(
            string SiteId,
            string PermissionTypeId,
            string ObjectId) 
        {
            return PermissionProcessBll.ReadingPermissionRoles(SiteId, PermissionTypeId, ObjectId);
        }

        public override string[] ReadingPermissionFunction(
            string SiteId,
            string PermissionTypeId)
        {
            return PermissionProcessBll.ReadingPermissionFunction(SiteId, PermissionTypeId);
        }

        public override PermissionRoleDetailCls[] ReadingPermissionRoleDetail(
            string SiteId,
            string PermissionTypeId,
            string PermissionRoleId)
        {
            return PermissionProcessBll.ReadingPermissionRoleDetail(SiteId, PermissionTypeId, PermissionRoleId);
        }

        public override void InitPermissionRoleDetail(
            IDbTransaction Trans,
            string SiteId,
            string PermissionTypeId,
            string PermissionRoleId) 
        {
            PermissionProcessBll.InitPermissionRoleDetail(Trans, SiteId, PermissionTypeId, PermissionRoleId);
        }

        public override RoleCls[] ReadingRoleForPermission(
            string SiteId,
            string PermissionTypeId,
            string ObjectId,
            string AccountType,
            string Keyword) 
        {
            return PermissionProcessBll.ReadingRoleForPermission(SiteId, PermissionTypeId, ObjectId, AccountType, Keyword);
        }

        public override UserCls[] ReadingUserForPermission(
            string SiteId,
            string PermissionTypeId,
            string ObjectId,
            string AccountType,
            string Keyword)
        {
            return PermissionProcessBll.ReadingUserForPermission(SiteId, PermissionTypeId, ObjectId, AccountType, Keyword);
        }

        public override void AddRolePermission(
            string SiteId,
            string ptc,
            string ObjectId,
            string[] RoleIds,
            string[] UserIds) 
        {
            PermissionProcessBll.AddRolePermission(SiteId, ptc, ObjectId, RoleIds, UserIds);
        }

        public override PermissionRoleCls CreatePermissionRoleModel(
           string SiteId,
           string PermissionRoleId) 
        {
            return PermissionProcessBll.CreatePermissionRoleModel(SiteId,PermissionRoleId); 
        }

        public override RoleCls[] ReadingRolesForUser(string SiteId, string UserId)
        {
            return RoleProcessBll.ReadingRolesForUser(SiteId, UserId);
        }

        public override void SetPermissionDetail(
            string SiteId,
            string PermissionRoleId,
            string[] PermissionDetailIds) 
        {
            PermissionProcessBll.SetPermissionDetail(SiteId, PermissionRoleId, PermissionDetailIds); 
        }

        public override void DeletePermissionRole(
            string SiteId,
            string PermissionRoleId) 
        {
            PermissionProcessBll.DeletePermissionRole(SiteId, PermissionRoleId);
        }

        public override bool CheckPermission(
            string SiteId,
            string ptc,
            string PermissionFunctionId,
            string ObjectId,
            string UserId,
            bool ThrowException) 
        {
            return PermissionProcessBll.CheckPermission(SiteId,ptc,PermissionFunctionId,ObjectId,UserId,ThrowException); 
        }

        //*********************************************
        public override RoleCls[] ReadingRoles(string SiteId, string RoleType, string Keyword)
        {
            return RoleProcessBll.ReadingRoles(SiteId, RoleType, Keyword);
        }
        public override RoleCls CreateRoleModel(string SiteId, string RoleId) 
        {
            return RoleProcessBll.CreateRoleModel(SiteId,RoleId); 
        }

        public override string AddRole(
            IDbTransaction Trans,
            string SiteId,
            string AssetCode,
            string RoleId,
            string RoleCode,
            string RoleName,
            string RoleType) 
        {
            return RoleProcessBll.AddRole(SiteId, AssetCode, RoleId, RoleCode, RoleName, RoleType);
        }

        public override void SaveRole(IDbTransaction Trans, string SiteId, string RoleId, string LoginName, string FullName)
        {
            RoleProcessBll.SaveRole(SiteId, RoleId, LoginName, FullName);
        }
        public override void DeleteRole(IDbTransaction Trans, string SiteId, string RoleId)
        {
            RoleProcessBll.DeleteRole(SiteId, RoleId);
        }

        //******************************************************************************************
        public override UserCls[] ReadingUsers(string SiteId, string UserType, string Keyword) 
        {
            return UserProcessBll.ReadingUsers(SiteId,UserType,Keyword); 
        }

        public override UserCls[] ReadingAvailableUser(string SiteId, string RoleId, string Keyword) 
        {
            return UserProcessBll.ReadingAvailableUser(SiteId,RoleId,Keyword); 
        }

        public override UserCls[] ReadingUserBelongRole(string SiteId, string RoleId, string Keyword) 
        {
            return UserProcessBll.ReadingUserBelongRole(SiteId,RoleId,Keyword); 
        }

        public override Collection<UserCls> ReadingUserBelongRoleForWorkflow(string SiteId, string[] RoleIds)
        {
            return RoleProcessBll.ReadingUserBelongRoleForWorkflow(SiteId, RoleIds);
        }

        public override UserCls CreateUserModel(string SiteId, string UserId) 
        {
            return UserProcessBll.CreateUserModel(SiteId,UserId); 
        }

        public override UserCls CheckHasUser(string SiteId, string AssetCode, string LoginName)
        {
            return UserProcessBll.CheckHasUser(SiteId, AssetCode, LoginName);
        }

        public override void AddUser(
            IDbTransaction Trans,
            string SiteId,
            string AssetCode,
            string UserId,
            string LoginName,
            string FullName,
            string Email,
            string Password,
            string ReTypePassword,
            string[] RoleIds,
            bool   CheckValid) 
        {
            UserProcessBll.AddUser(SiteId, AssetCode, UserId, LoginName, FullName, Email, Password, ReTypePassword, RoleIds, CheckValid);
        }


        public override void AddUserToRole(
            IDbTransaction Trans,
            string SiteId,
            string RoleId,
            string UserId) 
        {
            UserProcessBll.AddUserToRole(null, SiteId, RoleId, UserId);
        }

        public override void RemoveUserFromRole(
            IDbTransaction Trans,
            string SiteId,
            string RoleId,
            string UserId) 
        {
            UserProcessBll.RemoveUserFromRole(SiteId, RoleId, UserId);
        }

        public override void SaveUser(IDbTransaction Trans, string SiteId, string UserId, string LoginName, string FullName, string RoleId)
        {
            UserProcessBll.SaveUser(SiteId, UserId, LoginName, FullName,RoleId);
        }

        

        public override void DeleteUser(IDbTransaction Trans, string SiteId, string UserId) 
        {
            UserProcessBll.DeleteUser(SiteId, UserId);
        }

        public override void BlockUser(IDbTransaction Trans, string SiteId, string UserId,int LockVal)
        {
            UserProcessBll.BlockUser(SiteId, UserId,LockVal);
        }

        public override void ChangePassword(string SiteId, string AssetCode, string LoginName, string Password, string RePassword)
        {
            UserProcessBll.ChangePassword(SiteId, AssetCode,LoginName, Password, RePassword);
        }
        public override UserCls CheckForLogin(string SiteId, string AssetCode, string LoginName, string Password, ref int LoginAttempCount, ref string gLoginName)
        {
            return UserProcessBll.CheckForLogin(SiteId, AssetCode, LoginName, Password, ref LoginAttempCount, ref gLoginName);
        }

        public override AssetCls[] ReadingAssets(string SiteId)
        {
            return AssetProcessBll.ReadingAssets(SiteId);
        }

        public override AssetCls CreateAssetModel(string SiteId, string AssetCode)
        {
            return AssetProcessBll.CreateAssetModel(SiteId, AssetCode);
        }

        //public override string GetSelectRole(string SiteId)
        //{
        //    return UserProcessBll.GetSelectRole(SiteId);
        //}

        public override void DeleteNotExistsInObject(string SiteId, string PermissionTypeId)
        {
            PermissionProcessBll.DeleteNotExistsInObject(SiteId, PermissionTypeId);
        }


        public override void AddUserQuickLink(string SiteId, UserQuickLinkCls OUserQuickLink)
        {
            UserQuickLinkProcessBll.AddUserQuickLink(SiteId, OUserQuickLink);
        }

        public override UserQuickLinkCls CreateUserQuickLinkModel(string SiteId, string UserQuickLinkId)
        {
            return UserQuickLinkProcessBll.CreateUserQuickLinkModel(SiteId, UserQuickLinkId);
        }

        public override void DeleteUserQuickLink(string SiteId, string UserQuickLinkId)
        {
            UserQuickLinkProcessBll.DeleteUserQuickLink(SiteId, UserQuickLinkId);
        }

        public override UserQuickLinkCls[] ReadingUserQuickLinks(string SiteId, string UserId)
        {
            return UserQuickLinkProcessBll.ReadingUserQuickLink(SiteId, UserId);
        }


        public override void AddBackSession(string SiteId, BackSessionCls OBackSession)
        {
            BackSessionProcessBll.AddBackSession(SiteId, OBackSession);
        }

        public override BackSessionCls CreateBackSessionModel(string SiteId, string BackSessionId)
        {
            return BackSessionProcessBll.CreateBackSessionModel(SiteId, BackSessionId);
        }

        public override void DeleteBackSession(string SiteId, string BackSessionId)
        {
            BackSessionProcessBll.DeleteBackSession(SiteId, BackSessionId);
        }

        public override BackSessionCls[] ReadingBackSessions(string SiteId, string UserId)
        {
            return BackSessionProcessBll.ReadingBackSession(SiteId, UserId);
        }

        public override RoleMenuCls CreateRoleMenuModel(string SiteId, string RoleMenuId)
        {
            return RoleMenuProcessBll.CreateRoleMenuModel(SiteId, RoleMenuId);
        }

        public override void DeleteRoleMenu(string SiteId, string RoleMenuId)
        {
            RoleMenuProcessBll.DeleteRoleMenu(SiteId, RoleMenuId);
        }

        public override RoleMenuCls[] ReadingRoleMenus(string SiteId, string RoleId)
        {
            return RoleMenuProcessBll.ReadingRoleMenus(SiteId, RoleId);
        }

        public override void SaveRoleMenu(string SiteId, string AssetCode, string RoleId, RoleMenuCls[] ORoleMenu)
        {
            RoleMenuProcessBll.SaveRoleMenu(SiteId, AssetCode, RoleId, ORoleMenu);
        }

        public override void SyncRoleAndUsers(string SiteId, RoleCls[] Roles)
        {
            
        }

        //WebPage
        public override PageCls[] ReadingPage(string SiteId, string Keyword)
        {
            return PageProcessBll.ReadingPage(SiteId, Keyword);
        }

        public override void AddPage(string SiteId, PageCls OPage)
        {
            PageProcessBll.AddPage(SiteId, OPage);
        }

        public override void SavePage(string SiteId, string PageId, PageCls OPage)
        {
            PageProcessBll.SavePage(SiteId, PageId, OPage);
        }

        public override void DeletePage(string SiteId, string PageId)
        {
            PageProcessBll.DeletePage(SiteId, PageId);
        }

        public override PageCls CreatePageModel(string SiteId, string PageId)
        {
            return PageProcessBll.CreatePageModel(SiteId, PageId);
        }

        public override void DeployPage(string SiteId, string PageId)
        {
            base.DeployPage(SiteId, PageId);
        }

        public override void UnDeployPage(string SiteId, string PageId)
        {
            base.UnDeployPage(SiteId, PageId);
        }

        public override void PublishingPage(string SiteId, string PageId)
        {
            base.PublishingPage(SiteId, PageId);
        }

        public override void UnPublishingPage(string SiteId, string PageId)
        {
            base.UnPublishingPage(SiteId, PageId);
        }

        //page-zone
        public override PageZoneCls CreatePageZoneModel(string SiteId, string PageZoneId)
        {
            return PageZoneProcessBll.CreatePageZoneModel(SiteId, PageZoneId);
        }

        public override PageZoneCls[] ReadingPageZone(string SiteId, string PageId, string Keyword)
        {
            return PageZoneProcessBll.ReadingPageZone(SiteId, PageId, Keyword);
        }

        public override void AddPageZone(string SiteId, PageZoneCls OPageZone)
        {
            PageZoneProcessBll.AddPageZone(SiteId, OPageZone);
        }

        public override void DeletePageZone(string SiteId, string PageZoneId)
        {
            PageZoneProcessBll.DeletePageZone(SiteId, PageZoneId);
        }

        public override void PublishingPageZone(string SiteId, string PageZoneId)
        {
            base.PublishingPageZone(SiteId, PageZoneId);
        }

        public override void UnPublishingPageZone(string SiteId, string PageZoneId)
        {
            base.UnPublishingPageZone(SiteId, PageZoneId);
        }

        public override void SavePageZone(string SiteId, string PageZoneId, PageZoneCls OPageZone)
        {
            PageZoneProcessBll.SavePageZone(SiteId, PageZoneId, OPageZone);
        }

        //page-zone-module
        public override void AddPageZoneModule(string SiteId, PageZoneModuleCls OPageZoneModule)
        {
            PageZoneModuleProcessBll.AddPageZoneModule(SiteId, OPageZoneModule);
        }

        public override PageZoneModuleCls CreatePageZoneModuleModel(string SiteId, string PageZoneModuleId)
        {
            return PageZoneModuleProcessBll.CreatePageZoneModuleModel(SiteId, PageZoneModuleId);
        }

        public override void DeletePageZoneModule(string SiteId, string PageZoneModuleId)
        {
            PageZoneModuleProcessBll.DeletePageZoneModule(SiteId, PageZoneModuleId);
        }

        public override void PublishingPageZoneModule(string SiteId, string PageZoneModuleId)
        {
            
        }

        public override PageZoneModuleCls[] ReadingPageZoneModule(string SiteId, string PageZoneId)
        {
            return PageZoneModuleProcessBll.ReadingPageZoneModule(SiteId, PageZoneId);
        }

        public override void SavePageZoneModule(string SiteId, string PageZoneModuleId, PageZoneModuleCls OPageZoneModule)
        {
            PageZoneModuleProcessBll.SavePageZoneModule(SiteId, PageZoneModuleId, OPageZoneModule);
        }

        public override void UnPublishingPageZoneModule(string SiteId, string PageZoneModuleId)
        {
            
        }



        public override WorkflowDefCls CreateWorkflowDefModel(string SiteId, string WorkflowDefId)
        {
            return WorkflowDefProcessBll.CreateWorkflowDefModel(SiteId, WorkflowDefId);
        }

        public override WorkflowDefCls[] ReadingWorkflowDef(string SiteId)
        {
            return WorkflowDefProcessBll.ReadingWorkflowDef(SiteId);
        }

        public override WorkflowDefMapRoleCls[] ReadingWorkflowDefMapRoles(string SiteId, string WorkflowDefId, RoleCls[] WorkflowRoles)
        {
            return WorkflowDefProcessBll.ReadingWorkflowDefMapRoles(SiteId, WorkflowDefId, WorkflowRoles);
        }

        public override void SaveWorkflowDefMapRoles(string SiteId, string WorkflowDefId, WorkflowDefMapRoleCls[] WorkflowDefMapRoles)
        {
            WorkflowDefProcessBll.SaveWorkflowDefMapRoles(SiteId, WorkflowDefId, WorkflowDefMapRoles);
        }

        public override WorkflowControlCls[] ReadingWorkflowControls(string SiteId)
        {
            return WorkflowDefProcessBll.ReadingWorkflowControls(SiteId);
        }

        public override void SaveWorkflowControls(string SiteId, WorkflowControlCls[] WorkflowControls)
        {
            WorkflowDefProcessBll.SaveWorkflowControls(SiteId, WorkflowControls);
        }

        public override WorkflowDefCls CreateWorkflowDefFromWorkflowControl(string SiteId, string WorkflowControlId)
        {
            return WorkflowDefProcessBll.CreateWorkflowDefFromWorkflowControl(SiteId, WorkflowControlId);
        }

        public override DataLanguageCls[] ReadingDataLanguage(string SiteId)
        {
            return DataLanguageProcessBll.ReadingDataLanguage(SiteId);
        }

        public override DataLanguageCls CreateDataLanguageModel(string SiteId, string DataLanguageId)
        {
            return DataLanguageProcessBll.CreateDataLanguageModel(SiteId, DataLanguageId);
        }

        public override void SaveRoleExtraConfig(string SiteId, string RoleId, string DataLanguageId, RoleExtraConfigCls ORoleExtraConfig)
        {
            RoleExtraConfigProcessBll.SaveRoleExtraConfig(SiteId, RoleId, DataLanguageId, ORoleExtraConfig);
        }

        public override RoleExtraConfigCls CreateRoleExtraConfigModel(string SiteId, string AssetCode, string RoleId, string DataLanguage)
        {
            return RoleExtraConfigProcessBll.CreateRoleExtraConfigModel(SiteId, AssetCode, RoleId, DataLanguage);
        }

        public override RoleExtraConfigCls CreateRoleExtraConfigModel(string SiteId, string RoleExtraConfigId)
        {
            return RoleExtraConfigProcessBll.CreateRoleExtraConfigModel(SiteId, RoleExtraConfigId);
        }


        public override RoleWorkingWorkflowCls[] ReadingRoleWorkingWorkflow(string SiteId, string RoleId)
        {
            return RoleWorkingWorkflowProcessBll.ReadingRoleWorkingWorkflow(SiteId, RoleId);
        }

        public override void SaveRoleWorkingWorkflow(string SiteId, string RoleId, RoleWorkingWorkflowCls[] RoleWorkingWorkflow)
        {
            RoleWorkingWorkflowProcessBll.SaveRoleWorkingWorkflow(SiteId, RoleId, RoleWorkingWorkflow);
        }

        public override RoleWorkingWorkflowCls CreateRoleWorkingWorkflowModel(string SiteId, string RoleWorkingWorkflowId)
        {
            return RoleWorkingWorkflowProcessBll.CreateRoleWorkingWorkflowModel(SiteId, RoleWorkingWorkflowId);
        }

        public override RoleWorkingWorkflowCls[] ReadingAllowAccessRoleWorkingWorkflow(string SiteId, string RoleId)
        {
            return RoleWorkingWorkflowProcessBll.ReadingAllowAccessRoleWorkingWorkflow(SiteId, RoleId);
        }


        public override RoleWorkingWorkflowCls[] ReadingAllowAccessRoleWorkingWorkflow(string SiteId, string RoleId, string WorkflowControlType)
        {
            return RoleWorkingWorkflowProcessBll.ReadingAllowAccessRoleWorkingWorkflow(SiteId, RoleId, WorkflowControlType);
        }
        public override WorkflowControlCls CreateWorkflowControlModel(string SiteId, string WorkflowControlId)
        {
            return WorkflowDefProcessBll.CreateWorkflowControlModel(SiteId, WorkflowControlId);
        }

        public override bool CheckAllowAccessWorkflow(string SiteId, string RoleId, string WorkflowDefId)
        {
            return RoleWorkingWorkflowProcessBll.CheckAllowAccessWorkflow(SiteId, RoleId, WorkflowDefId);
        }


        //Group Role
        public override string AddGroupRole(IDbTransaction Trans, string SiteId, string AssetCode, string GroupRoleId, string GroupRoleName, int SortIndex)
        {
            return GroupRoleProcessBll.AddGroupRole(Trans, SiteId, AssetCode, GroupRoleId, GroupRoleName, SortIndex);
        }

        public override void AddRoleToGroupRole(IDbTransaction Trans, string SiteId, string GroupRoleId, string RoleId)
        {
            GroupRoleProcessBll.AddRoleToGroupRole(Trans, SiteId, GroupRoleId, RoleId);
        }

        public override GroupRoleCls CreateGroupRoleModel(string SiteId, string GroupRoleId)
        {
            return GroupRoleProcessBll.CreateGroupRoleModel(SiteId, GroupRoleId);
        }

        public override void DeleteGroupRole(IDbTransaction Trans, string SiteId, string GroupRoleId)
        {
            GroupRoleProcessBll.DeleteGroupRole(Trans, SiteId, GroupRoleId);
        }

        public override GroupRoleCls[] ReadingGroupRoles(string SiteId, string Keyword)
        {
            return GroupRoleProcessBll.ReadingGroupRoles(SiteId, Keyword);
        }

        public override RoleCls[] ReadingRoleForGroupRole(string SiteId, string GroupRoleId)
        {
            return GroupRoleProcessBll.ReadingRoleForGroupRole(SiteId, GroupRoleId);
        }

        
        public override void SaveGroupRole(IDbTransaction Trans, string SiteId, string GroupRoleId, string GroupRoleName, int SortIndex)
        {
            GroupRoleProcessBll.SaveGroupRole(Trans, SiteId, GroupRoleId, GroupRoleName, SortIndex);
        }


        public override RoleCls[] ReadingRoleAvailableForGroupRole(string SiteId, string GroupRoleId,string Keyword)
        {
            return GroupRoleProcessBll.ReadingRoleAvailableForGroupRole(SiteId, GroupRoleId, Keyword);
        }

        public override RoleCls[] ReadingRoleBelongGroupRole(string SiteId, string GroupRoleId, string Keyword)
        {
            return GroupRoleProcessBll.ReadingRoleBelongGroupRole(SiteId, GroupRoleId, Keyword);
        }

        public override void RemoveRoleFromGroupRole(IDbTransaction Trans, string SiteId, string GroupRoleId, string RoleId)
        {
            GroupRoleProcessBll.RemoveRoleFromGroupRole(Trans, SiteId, GroupRoleId, RoleId);
        }

        public override void RemoveRoleFromGroupRole(IDbTransaction Trans, string SiteId, string RoleInGroupRoleId)
        {
            GroupRoleProcessBll.RemoveRoleFromGroupRole(Trans, SiteId, RoleInGroupRoleId);
        }

        public override System.Collections.ObjectModel.Collection<UserCls> ReadingUsersInGroupRoles(string SiteId, string[] GroupRoleIds)
        {
            return GroupRoleProcessBll.ReadingUsersInGroupRoles(SiteId, GroupRoleIds);
        }

        
        public override string[] ConvertSystemGroupRoleFromWorkflowGroupRole(string SiteId, string WorkflowDefId, string[] GroupRoleIds)
        {
            return GroupRoleProcessBll.ConvertSystemGroupRoleFromWorkflowGroupRole(SiteId, WorkflowDefId, GroupRoleIds);
        }


        public override void AddRoleRelationTemplate(
            IDbTransaction Trans,
            string SiteId,
            string AssetCode,
            string RoleRelationTemplateName,
            int SortIndex,
            string XmlData)
        {
            RoleRelationTemplateProcessBll.AddRoleRelationTemplate(
                (SqlTransaction)Trans,
                SiteId,
                AssetCode,
                RoleRelationTemplateName,
                SortIndex,
                XmlData);
        }

        public override RoleRelationTemplateCls CreateRoleRelationTemplateModel(string SiteId, string RoleRelationTemplateId)
        {
            return RoleRelationTemplateProcessBll.CreateRoleRelationTemplateModel(SiteId, RoleRelationTemplateId);
        }

        public override void DeleteRoleRelationTemplate(IDbTransaction Trans, string SiteId, string RoleRelationTemplateId)
        {
            RoleRelationTemplateProcessBll.DeleteRoleRelationTemplate((SqlTransaction)Trans, SiteId, RoleRelationTemplateId);
        }

        public override RoleRelationTemplateCls[] ReadingRoleRelationTemplate(string SiteId,string Keyword)
        {
            return RoleRelationTemplateProcessBll.ReadingRoleRelationTemplate(SiteId, Keyword);
        }

        public override void SaveRoleRelationTemplate(
            IDbTransaction Trans,
            string SiteId,
            string RoleRelationTemplateId,
            string RoleRelationTemplateName,
            string XmlData)
        {
            RoleRelationTemplateProcessBll.SaveRoleRelationTemplate(
                (SqlTransaction)Trans,
                SiteId,
                RoleRelationTemplateId,
                RoleRelationTemplateName,
                XmlData
                );
        }

        public override void SavePageZoneModuleView(string SiteId, string PageZoneModuleId, string PlugInViewId)
        {
            PageZoneModuleProcessBll.SavePageZoneModuleView(SiteId, PageZoneModuleId, PlugInViewId);
        }

        public override void SavePageZoneForMove(string SiteId, string PageZoneModuleId, string PageZoneId)
        {
            PageZoneModuleProcessBll.SavePageZoneForMove(SiteId, PageZoneModuleId, PageZoneId);
        }

        public override void SavePageZoneModuleInfo(string SiteId, PageZoneModuleCls[] PageZoneModules)
        {
            PageZoneModuleProcessBll.SavePageZoneModuleInfo(SiteId, PageZoneModules);
        }

        public override PageZoneModuleCls[] ReadingModulesInPage(string SiteId, string PageId)
        {
            return PageZoneModuleProcessBll.ReadingModulesInPage(SiteId, PageId);
        }

        public override void SavePageZoneModuleConfig(string SiteId, string PageZoneModuleId, string XmlDataConfig)
        {
            PageZoneModuleProcessBll.SavePageZoneModuleConfig(SiteId, PageZoneModuleId, XmlDataConfig);
        }

        public override void SaveArchiveTempFile(
            IDbTransaction Trans,
            string SiteId,
            string ArchiveTempFileId,
            string SaveFile,
            string SaveTitle)
        {
        }

        public override void DeleteArchiveTempFile(IDbTransaction Trans, string SiteId, string ArchiveTempFileId)
        {
            
        }

        public override void MoveRoleToAccountType(string SiteId, string[] AccountTypes, string RoleId)
        {
            AccountTypeProcessBll.MoveRoleToAccountType(SiteId, AccountTypes, RoleId);
        }

        public override AccountTypeCls[] ReadingAccountTypeForRole(string SiteId, string RoleId)
        {
            return AccountTypeProcessBll.ReadingAccountTypeForRole(SiteId, RoleId);
        }

        public override string DuplicatePage(string SiteId, string PageId)
        {
            return PageProcessBll.DuplicatePage(SiteId, PageId);
        }

        public override RoleCls[] ReadingRolesForDatabaseFolderPermission(string SiteId, string DatabaseFolderId, string Keyword)
        {
            return RoleProcessBll.ReadingRolesForDatabaseFolderPermission(SiteId, DatabaseFolderId, Keyword);
        }

        public override UserCls[] ReadingUserForDatabaseFolderPermission(string SiteId, string DatabaseFolderId, string Keyword)
        {
            return UserProcessBll.ReadingUserForDatabaseFolderPermission(SiteId, DatabaseFolderId, Keyword);
        }


        public override RoleCls[] ReadingRolesForDatabaseFieldPermission(
            string SiteId,
            string DatabaseFieldId, 
            string Keyword)
        {
            return RoleProcessBll.ReadingRolesForDatabaseFieldPermission(SiteId, DatabaseFieldId, Keyword);
        }

        public override UserCls[] ReadingUserForDatabaseFieldPermission(
            string SiteId,
            string DatabaseFieldId, 
            string Keyword)
        {
            return UserProcessBll.ReadingUserForDatabaseFieldPermission(SiteId, DatabaseFieldId, Keyword);
        }
    }
}
